<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>换寝审批</title>
    <link href="../../static/css/bootstrap.min.css" rel="stylesheet" th:href="@{/static/css/bootstrap.min.css}">
    <!-- Custom styles for this template -->
    <link href="../../static/css/dashboard.css" rel="stylesheet" th:href="@{/static/css/dashboard.css}">
</head>
<body>
<div th:insert="admin/common::topbar"></div>
<div class="container-fluid">
    <div class="row">
        <div th:insert="~{admin/common::sidebar(active='operateDorm.html')}"></div>
        <main class="col-md-9 ml-sm-auto col-lg-10 pt-3 px-4" role="main">
            <div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pb-2 mb-3 border-bottom">
                <h1 class="h3">换寝审批</h1>
                <div class="btn-toolbar mb-2 mb-md-0">
                    <div class="btn-group mr-2">
                        <button class="btn btn-sm btn-outline-secondary" id="btn-applyDorm">住校审批</button>
                        <button class="btn btn-sm btn-outline-secondary" id="btn-stuDorm">住校学生</button>
                        <button class="btn btn-sm btn-outline-secondary" id="btn-quitDorm">走读审批</button>
                    </div>
                    <div class="btn-group mr-2">
                        <button class="btn btn-primary btn-sm btn-outline-secondary" id="btn-admin">管理员</button>
                        <button class="btn btn-sm btn-outline-secondary" id="btn-student">学生端</button>
                    </div>
                </div>
            </div>
            <div th:switch="${size>0}">
                <div class="table-responsive" th:case="true">
                    <table class="table table-striped table-hover table-bordered table-sm">
                        <thead>
                        <tr>
                            <th>学号</th>
                            <th>姓名</th>
                            <th>性别</th>
                            <th>申请</th>
                            <th>原来的寝室</th>
                            <th>申请的寝室</th>
                            <th>原来的床位</th>
                            <th>申请的床位</th>
                            <th>申请的理由</th>
                            <th>申请时间</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr th:each="map:${map}">
                            <th id="sno" th:text="${map.getKey().getSno()}" th:value="${map.getKey().getSno()}"></th>
                            <th th:text="${map.getKey().getSname()}"></th>
                            <th th:text="${map.getKey().getSex()}"></th>
                            <th th:text="${'申请更换寝室'}"></th>
                            <th th:text="${map.getValue().getDormPlace()}"></th>
                            <th th:text="${map.getKey().getDormPlace()}"></th>
                            <th th:text="${map.getValue().getBed_id()}"></th>
                            <th th:text="${map.getKey().getBed_id()}"></th>
                            <th th:text="${map.getKey().getReason()}"></th>
                            <th th:text="${map.getKey().getTime()}"></th>
                            <th>
                                <button class="btn btn-sm btn-success" id="btn-agree2" th:value="${map}">同意</button>
                                <button class="btn btn-sm btn-warning" id="btn-refuse2" th:value="${map}">拒绝</button>
                            </th>
                        </tr>
                        <!--<tr th:each="list:${List}">
                            <th th:text="${list.getSno()}"></th>
                            <th th:text="${list.getSname()}"></th>
                            <th th:text="${list.getSex()}"></th>
                            <th th:text="${'申请更换寝室'}"></th>
                            <th th:text="${map.get(list).getDormPlace()}"></th>
                            <th th:text="${list.getDormPlace()}"></th>
                            <th th:text="${map.get(list).getBed_id()}"></th>
                            <th th:text="${list.getBed_id()}"></th>
                            <th th:text="${list.getReason()}"></th>
                            <th th:text="${list.getTime()}"></th>
                            <th>
                                <button id="btn-agree2"  th:value="${list.getSno()}"  class="btn btn-sm btn-success">同意</button>
                                <button   th:value="${list.getSno()}"  id="btn-refuse2" class="btn btn-sm btn-warning">拒绝</button>
                            </th>
                        </tr>-->
                        </tbody>
                    </table>
                </div>
                <div th:case="false">
                    <h1>暂无学生申请!</h1>
                </div>
            </div>
        </main>
    </div>
</div>
<script src="../../static/js/jquery-3.6.0.js" th:src="@{/static/js/jquery-3.6.0.js}"></script>
<script src="../../static/js/bootstrap.min.js" th:src="@{/static/js/bootstrap.min.js}" type="text/javascript"></script>
<script src="../../static/js/btn.js" th:src="@{/static/js/btn.js}"></script>
<script>

</script>

</body>
</html>